home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 118 / cd-rom 118.iso / aplic / open / openofficeorg4.cab / test_difflib.py < prev    next >
Encoding:
Python Source  |  2005-02-15  |  473 b   |  19 lines

  1. import difflib
  2. from test import test_support
  3. import unittest
  4. import doctest
  5.  
  6. class TestSFbugs(unittest.TestCase):
  7.  
  8.     def test_ratio_for_null_seqn(self):
  9.         # Check clearing of SF bug 763023
  10.         s = difflib.SequenceMatcher(None, [], [])
  11.         self.assertEqual(s.ratio(), 1)
  12.         self.assertEqual(s.quick_ratio(), 1)
  13.         self.assertEqual(s.real_quick_ratio(), 1)
  14.  
  15. Doctests = doctest.DocTestSuite(difflib)
  16.  
  17. test_support.run_unittest(TestSFbugs, Doctests)
  18.  
  19.